package com.example.enterprise.service;

import com.example.enterprise.dao.RiskLedgerMapper;
import com.example.enterprise.entity.RiskLedgerExample;
import com.example.enterprise.entity.RiskLedgerWithBLOBs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RiskLedgerService {
    @Autowired
    private RiskLedgerMapper riskLedgerMapper;

    public List<RiskLedgerWithBLOBs> findRiskLedger(int offset, int limit) {
        RiskLedgerExample example = new RiskLedgerExample();
        example.setOrderByClause("id desc limit " + offset + "," + limit);
        List<RiskLedgerWithBLOBs> riskLedgerWithBLOBs = riskLedgerMapper.selectByExampleWithBLOBs(example);
        return riskLedgerWithBLOBs;
    }
}
